package com.yn.xgame.logic.handler;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.yn.xgame.DBHandler;
import com.yn.xgame.XAssert;
import com.yn.xgame.logic.GamePlayer;
import com.yn.xgame.message.C2GPbRedirectMessage;

public class BankTransactionHandler extends DBHandler {
	private static final Logger logger = LoggerFactory.getLogger(BankTransactionHandler.class);
	@Override
	public Logger logger() {
		return null;
	}
	public BankTransactionHandler(QueryRunner runner,Connection conn){
		m_runner=runner;
		m_conn=conn;
	}
	public  Pair<Integer, String> drawMoney(C2GPbRedirectMessage msg,GamePlayer player){
		
	//	GamePlayer player= playerManager.getPlayerBySessionId(msg.getSessionId());
		XAssert.nonNull(player, msg);
		player.getUserBankModule().handleWithDrawMoney(msg);
		try {
			m_conn.setAutoCommit(false);
			m_conn.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
			
			
			
			
		} catch (SQLException e) {
			
		}
		
		
		return null;
	}
	public void handleResult(C2GPbRedirectMessage msg, Pair<Integer, String> result){
		
	}
}
